Skip to content

fix: sort 파라미터 없는 요청에서 발생하던 500 에러 수정 - #229

Merged
unam98 merged 1 commit into
mainfrom
fix/sort-parameter-npe-prod
Aug 6, 2026
Merged

fix: sort 파라미터 없는 요청에서 발생하던 500 에러 수정#229
unam98 merged 1 commit into
mainfrom
fix/sort-parameter-npe-prod

Conversation

@unam98

@unam98 unam98 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

작업 배경

변경 사항

영역 내용
common/resolver/sort/SortStatusIdResolver.java request.getQueryString()이 null일 때(쿼리 파라미터가 전혀 없을 때) NPE로 500이 나던 버그 수정

영향 범위

  • GET /api/public-course(퍼블릭 코스 추천/메인 피드 엔드포인트)를 쿼리 파라미터 없이 호출하면 HttpServletRequest.getQueryString()이 null을 반환해 SortStatusIdResolvernull.split()으로 NPE → 500을 반환하던 버그. sort 키만 없는 경우(예: ?pageNo=1)는 이미 정상 처리되고 있었다.
  • 수정 후 쿼리 파라미터가 아예 없어도 기본 정렬("date")로 정상 처리된다. 기존에 정상 동작하던 케이스(쿼리 파라미터가 있는 경우)의 동작은 변경 없음.

Test Plan

  • 로컬 컴파일 확인 (./gradlew compileJava)
  • 로컬 postgres/redis(raw docker) 기동 후 ./gradlew test 전체 통과 확인

🤖 Generated with Claude Code

GET /api/public-course를 쿼리 파라미터 없이(예: 그냥 /api/public-course) 호출하면
HttpServletRequest.getQueryString()이 null을 반환하는데, SortStatusIdResolver가
이를 null 체크 없이 split()하다가 NPE(500)로 이어지던 버그를 수정했다. sort 키가
없는 경우와 동일하게 기본값("date")으로 처리하도록 했다.
@unam98 unam98 self-assigned this Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 737ef596-706e-4db9-bd6d-233fbda739c5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@unam98
unam98 merged commit 8140b37 into main Aug 6, 2026
2 checks passed
@unam98
unam98 deleted the fix/sort-parameter-npe-prod branch August 6, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants